#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <fstream>
#include <iostream>
#include <armadillo>
#include <iomanip>
#include <vector>

using namespace std;
using namespace arma;

#include "optflow_feat_def.hpp"
#include "optflow_feat_impl.hpp"



uword ro = 120;
uword co = 160;
//Optical Flow features
//Knn classifier: N=3

//NICTA
const std::string path = "/home/johanna/codes/multi-actions/kth_testing/"; 
const std::string path_multi = "/home/johanna/codes/multi-actions/kth_multi/"; 


//Home
//const std::string path = "/home/johanna/codes-svn/multi-action/kth_testing/";
//const std::string path_multi = "/home/johanna/codes-svn/multi-action/kth_multi/"; 

//UQ-server
//const std::string path = "/home/users/uqjcarva/Johanna/codes-linux/multi-actions/kth_testing/"; 



//wanda
//const std::string path = "/data2/Users/johanna/codes-wanda/kth_testing/";



////When I need to save
const std::string  feat_path ="./features/"; //Create this folder


///OJO!!!!!!!!!!!!!!
const std::string  actionNames = "actionNames.txt";



int
main(int argc, char** argv)
{
 
  vec vNcents;
  vNcents << 8 << 16 <<32 << 64 << 128 << endr;
  
  

  opt_feat kth_optflow(path, actionNames, feat_path, co, ro);
  //kth_optflow.features_per_action_training();
  //kth_optflow.feature_testing(); //single action
  
  
  ///Creating GMM models using training Videos
  /*
  for (uword i = 0; i < vNcents.n_elem; ++i)
  {
    int N_cent = vNcents(i);
    kth_optflow.create_gmm_action(N_cent);
    
  }
  */
  
//int N_cent = 16;
//kth_optflow.create_gmm_action(N_cent);
    
 
    
  ///Testing Single Action
  /*
  for (uword i = 0; i < vNcents.n_elem; ++i)
  {
    int N_cent = vNcents(i);
    kth_optflow.gmm_testing(N_cent);
  }
  
  */
  
   //Probando con datos normalizados
   /*
  int N_cent = 16;
  kth_optflow.create_gmm_action(N_cent); 
  kth_optflow.gmm_testing(N_cent);
  */
  
  ///Testing Multi-Action
  
  //Calculating features for multi-videos:
  //kth_optflow.feature_multi_action( path_multi );
  int N_cent = 16;
  kth_optflow.gmm_multi_action( N_cent );
  
  

// uvec a;
// a << 1 << 5 << 8 << 15 << endr;
// uvec b;
// b << 2 << 5 << 9 << 15 << endr;
// 
// uvec c = find (a==b);
// c.print("c");
// getchar();


  
    
  
  
}



